<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="thx" uri="/thx-tags"%>
<%@ taglib prefix="fun" uri="http://java.sun.com/jsp/jstl/functions"%>
<div class="content">
	<div class="row">
		<div class="col-md-12">
				<div class="box-header with-border">
					<div class="row">
						<form class="search-panel" action="user/user!list.action" name="search-form" result-container="#user-list">
							<input type="text" class="form-control" placeholder="用户名" name="entity.userName" value="${entity.userName }">
				            <input type="text" name="entity.realName" value="${entity.realName }" class="form-control" placeholder="姓名">
							<input type="text" name="entity.email" value="${entity.email }" class="form-control" placeholder="邮箱">
							<input type="text" name="entity.mobilePhone" value="${entity.mobilePhone }" class="form-control" placeholder="手机号">
				            <button type="button" class="btn btn-primary search-btn"  >搜索</button>
						</form>
					</div>
				</div>
				<div class="box-body no-padding">
					<div class="row">
						<div class="col-sm-12">
							<table class="table table-bordered">
								<tr>
				                	<th>用户名</th>
				                    <th>姓名</th>
				                    <th>邮箱</th>
				                    <th>手机号</th>
				                    <th>操作</th>
				                </tr>
								<c:if test="${empty list}">
				                <tr>
				                	<td colspan="5">
				                	暂无数据！
				                	</td>
				                </tr>
				                </c:if>
				                <c:forEach items="${list}" var="user">
				                <tr>
				                	<td>${user.userName }</td>
				                    <td>${user.realName }</td>
				                    <td>${user.email }</td>
				                    <td>${user.mobilePhone }</td>
				                    <td>
										<button type="button"
												title="用户详情"
												data-toggle="tooltip"
												data-placement="bottom"
												open-url="user/user!view.action?id=${user.userId}"
												class="btn btn-default btn-sm btn-open-form">
												<i class="fa fa-sticky-note-o"></i>
										</button>
										<thx:privileged id="sys_user_add">
											<button type="button"
													title="修改用户"
													data-toggle="tooltip"
													data-placement="bottom"
													open-url="user/user!input.action?id=${user.userId}"
													class="btn btn-default btn-sm btn-open-form">
													<i class="fa fa-edit"></i>
											</button>
										</thx:privileged>
										<thx:privileged id="sys_privelege">
											<button type="button"
													title="用户授权"
													width="400"
													data-toggle="tooltip"
													data-placement="bottom"
													open-url="privilege/privilege!auth.action?authType=user&authObjId=${user.userId}"
													class="btn btn-default btn-sm btn-open-win">
													<i class="fa fa-key"></i>
											</button>
										</thx:privileged>
										<thx:privileged id="sys_resetPwd">
											<button type="button"
													title="密码重置"
													data-toggle="tooltip"
													data-placement="bottom"
													open-url="user/user!sysResetPwd.action?message=systemReset&id=${user.userId}"
													class="btn btn-default btn-sm btn-open-form">
													<i class="fa fa-reply"></i>
											</button>
										</thx:privileged>
				                        <thx:privileged id="user/user!setDelStatus.action" idName="url">
											<button type="button"
													title="删除用户"
													data-toggle="tooltip"
													data-placement="bottom"
													do-url="user/user!delete.action?id=${user.userId}"
													load-url="user/user!list.action"
													load-container="#user-list"
													confirm-msg="确定要删除吗？"
													class="btn btn-default btn-sm btn-open-confirm-win">
													<i class="fa fa-trash"></i>
											</button>
										</thx:privileged>
									</td>
				                </tr>
				                </c:forEach>
							</table>
						</div>
					</div>
				</div>
				<div class="box-footer">
					 <!--分页区-->
					<div class="pagePanel">
			           	 <thx:pages pageNo="page.curPage" total="page.totalPage"  theme="number">
							<s:param name="entity.userName" value="entity.userName"></s:param>
							<s:param name="entity.realName" value="entity.realName"></s:param>
							<s:param name="entity.email" value="entity.email"></s:param>
							<s:param name="entity.mobilePhone" value="entity.mobilePhone"></s:param>
							<s:param name="deptId" value="deptId"></s:param>
						</thx:pages>
					</div>
					 <!--底部操作区-->
					<div class="handlePanel">
					   <thx:privileged id="sys_user_add">
						   	 <a title="新增用户"
						   	 	open-url="user/user!input.action?deptId=${deptId}"
						   	 	class="a-btn btn-open-form">
						   	 	<span class="fa fa-plus"></span>
								<span class="text">新增</span>
							 </a>
					   </thx:privileged>
					</div>
				</div>
		</div>
	</div>
</div>
<script>
	$( function() {
		list.init();
		page.init("#user-list");
	});
</script>